/**
 * Created by Administrator on 2016/12/19 0019.
 */

function sendAnnounce() {

    var text=$("#idAnnounceText").val();
    if (text == ""){
        alert("公告内容是空的,请重新输入");
        return;
    }
    var timestamp = Date.parse(new Date());
    timestamp = timestamp / 1000; //以秒为单位，方便golang转换
    var announceData ={
        "announce":text,
        "sendtime":timestamp,
    };

    $.post("/sendAnnounceText",announceData)
        .success(function() {
             alert("发送公告成功");
            }
        )
        .error(function() {
               alert("发送公告失败");
        });
}

